﻿using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore;
using EntityModels.DbContexts;

namespace EntityModels.Normal
{
    /// <summary>
    /// 在一个上下文类型中使用多个模型
    /// </summary>
    public class DynamicModelCacheKeyFactory : IModelCacheKeyFactory
    {
        public object Create(DbContext context, bool designTime)
        => (context.GetType(), (context as DynamicModelDbContext)?.Database.IsSqlServer());
    }
}
